$(function () {
    var itemIndex = 0;
    var tabLoadEndArray = [false];
    var tabScroolTopArray = [0];
    var pagenum = 1;
    var dropload = $('.khfxWarp').dropload({
        scrollArea: window,
        domDown: {
            domClass: 'dropload-down',
            domRefresh: '<div class="dropload-refresh">上拉加载更多</div>',
            domLoad: '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
            domNoData: '<div class="dropload-noData">没有更多收藏了</div>'
        },
        loadDownFn: function (me) {
            setTimeout(function () {
                if (tabLoadEndArray[itemIndex]) {
                    me.resetload();
                    me.lock();
                    me.noData();
                    me.resetload();
                    return;
                }
                $.ajax({
                    url: '/load/getpageCollet',
                    type: "GET",
                    data: {page: pagenum},
                    dataType: "json",//请求数据类型
                    success: function (data) {
                    	if(data.code == 0){
	   						 var result = data.data;
	   						 $("#datalist").append(result);
	   						 if(data.hasnext){
	   							 pagenum++;
	   						 }else{
	   							tabLoadEndArray[itemIndex] = true;
	   						 }
	   					 }
                    },
                    error: function () {
                    	sstb.dialog('加载失败');
                    }
                })
                me.resetload();
            }, 500);
        }
    });

});